﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.ServiceModel;
using Client.Service;
using ModelLayer;


namespace Client
{
    public partial class SeatBook : Form
    {
        private IShow showService;
        private ISeat seatService;
        
        
        public SeatBook()
        {
            InitializeComponent();
            showService = new ShowClient("BasicHttpBinding_IShow");
            seatService = new SeatClient("BasicHttpBinding_ISeat");
            Show show = showService.GetShow(8);
            //List<Show> shows = new List<Show>(showService.GetAllShows());

            cbShow.Text = show.Type.Title;
            cbDate.Text = show.Date.Date.ToLongDateString();
            cbTime.Text = show.Date.TimeOfDay.ToString();
            lblLokale.Text = show.Room.RoomNumber.ToString();
            lblPrice1.Text = "DKR:  " + show.Prices[1].TicketPrice.ToString();
            lblPrice2.Text = "DKR:  " + show.Prices[0].TicketPrice.ToString();
            lblPrice3.Text = "DKR:  " + show.Prices[2].TicketPrice.ToString();
            //List<Show> shows = new List<Show>().showService.GetAllShows();
            //List<Show> shows = new List<Show>(showService.GetAllShows());
            //cbShow.Items.Add(
            //showService.GetAllShows()
            getAll();
           
        }

        

        public void getAll()
        {
            List<Show> shows = new List<Show>(showService.GetAllShows());
            
            for (int i = 0; i < shows.Count(); i++)
            {
                Show s = shows[i];
                cbShow.Items.Add(s.Type.Title.ToString());


            }

            

            
        }

        private void cbShow_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbShow.SelectedValue == null)
                return;
            else
            {
                cbShow.SelectedValue.ToString();
            }
        }

        private void cbDate_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        

        
    }
}
